<?php foreach ($t['posts'] as $p): ?>
<?php 
    $tags = array();
    foreach ($p['tags'] as $tag) {
        $route = $ro->gen('tag', array('tag'=>$tag));
        $tags[] = sprintf('<a href="%s">%s</a>', $route, $tag);
    }
?>
<div class="entry<?php if (!$p['published']) echo ' not-published';?>">
<div class="title"><a href="<?php echo $p['show_route']; ?>"><?php echo htmlspecialchars($p['title']); ?></a></div>
<div class="service">
    <a href=""><?php echo $p['D']; ?></a>-<a href=""><?php echo $p['M']; ?></a>-<a href=""><?php echo $p['Y']; ?></a>
    <?php echo $p['time']; ?> |
    <?php echo $p['comments']; ?> comments |
    <!-- 0 pingbacks | -->
    tags: <?php echo implode(', ', $tags);; ?>
</div>
<?php if ($us->isAuthenticated() && $us->hasCredential('posts.edit') && $us->hasCredential('posts.delete')): ?>
    <div class="service"><a href="<?php echo $p['edit_route']; ?>">edit</a> |
        <a href="<?php echo $p['delete_route']; ?>">delete</a>
    </div>
<?php endif; ?>
<div class="body"><?php echo $p['body']; ?>
<?php if ($p['read_more']):?>
<div><a href="<?php echo $p['show_route']; ?>">continue reading</a></div>
<?php endif;?>
</div>
</div>
<?php endforeach;?>

<div class="paging">
<?php if (isset($t['newer_url'])):?>
<a href="<?php echo $t['newer_url'];?>">newer</a>
<?php else:?>
<span class="na"><?php echo $tm->_('newer', 'default.general');?></span>
<?php endif;?>

<?php if (isset($t['older_url'])):?>
<a href="<?php echo $t['older_url'];?>">older</a>
<?php else:?>
<span class="na">older</span>
<?php endif;?>
</div>
